package main;

public class GameFile implements Cloneable {

	private String pathFile;
	private long modDate;
	private long size;
	
	public GameFile(String relPath, long modDate, long size){
		this.pathFile = relPath;
		this.modDate = modDate;
		this.size = size;
	}

	public long getSize() {
		return size;
	}

	public String getPathFile() {
		return pathFile;
	}
	
	public String getFile(){
		int i = pathFile.lastIndexOf('\\');
		if(i<0) return pathFile;
		else return pathFile.substring(i+1, pathFile.length());
	}
	
	public String getPath(){
		int i = pathFile.lastIndexOf('\\');
		if(i==-1) return "";
		else return pathFile.substring(0, i+1);
	}

	public long getModDate() {
		return modDate;
	}
	
	
	@Override
	protected GameFile clone() throws CloneNotSupportedException {
		return new GameFile(new String(pathFile), modDate, size);
	}
	
	@Override
	public String toString() {
		return "["+pathFile+","+modDate+","+size+"]";
	}

}
